import {NgModule} from "@angular/core";
import {RouterModule, Routes} from "@angular/router";
import {SharedModule} from "../../shared/shared.module";

import {SupplierListComponent} from "./supplier-list/supplier-list.component";
import {SupplierDetailComponent} from "./supplier-detail/supplier-detail.component";
import {SupplierEditComponent} from "./supplier-edit/supplier-edit.component";

const routes: Routes = [
            {path: '', redirectTo: 'list'},
        {path: 'list', component: SupplierListComponent},
        {path: 'add', component: SupplierEditComponent},
        {path: 'modify/:code', component: SupplierEditComponent},
        {path: 'detail/:code', component: SupplierDetailComponent}
]

@NgModule({
  imports: [
    SharedModule.forRoot(),
    RouterModule.forChild(routes)
  ],
  declarations: [
    SupplierListComponent,
    SupplierDetailComponent,
    SupplierEditComponent
  ],
  providers: []
})
export class SupplierModule {
}
